
<div class="item">

        <? if($post->user_id == $this->tank_auth->get_user_id() && ( time() - $post->date_posted_timestamp) < 300): ?>
        <div class="post_options">
            <a class="delete" id="<?=$post->post_id?>">Delete</a>
            <div class="delete_confirmation">
                <div class="question">Weet je het zeker?</div>
                <a class="yes">Ja</a>
                <a class="no">Nee</a>
            </div>
            <a class="Edit">Edit</a>
        </div>
        <? endif; ?>

        <?
        $data["post"] = $post;
        if ($post->type == "message"):
            $this->load->view("posts/message", $data);
        elseif ($post->type == "poll"):
            $this->load->view('posts/poll', $data);
        elseif ($post->type == "event"):
            $this->load->view('posts/event_post', $data);
        elseif ($post->type == "avatar_change"):
            $this->load->view('posts/avatar_change', $data);
        else:
            echo '<div class="message">** ERROR: Post type "' . $post->type . '" unsupported **</div>';
        endif;
         ?>


        <? $isNotification = $post->type != "event" && $post->type != "avatar_change" ?>

        <? if ($isNotification): ?>
            <h2><a class="fancy_box" href="<?=base_url("profile/$post->user_id"); ?>"><?=$post->display_name;?></a></h2>
        <a class="fancy_box" href="<?=base_url("profile/$post->user_id"); ?>">
            <? $this->load->view("posts/avatar.php", array("filename" => $post->avatar_filename, "css_class" => "avatar"));?>
        </a>
        <? endif; ?>
        <div class='datum_bar'><?=$post->date_posted;?></div>

    <? if ($isNotification): ?>
        <img class='post_spacer' src='<?=base_url("images/layout/post_frame.png")?>' />
    <? endif; ?>

</div>

